package com.jl.card.util;

public class APDUUtil {

	public static byte[] make(byte cla, byte ins, byte p1, byte p2,
			byte[] data) {
		byte[] apdu = new byte[data.length + 5];
		apdu[0] = cla;
		apdu[1] = ins;
		apdu[2] = p1;
		apdu[3] = p2;
		apdu[4] = (byte) data.length;
		System.arraycopy(data, 0, apdu, 5, data.length);
		return apdu;
	}

	public static byte[] make(byte cla, byte ins, byte p1, byte p2, byte le) {
		byte[] apdu = new byte[5];
		apdu[0] = cla;
		apdu[1] = ins;
		apdu[2] = p1;
		apdu[3] = p2;
		apdu[4] = le;
		return apdu;
	}
}
